package com.lei.yohuo001java.adapter;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.lei.yohuo001java.R;
import com.lei.yohuo001java.bean.GoodsEntiy;

import java.util.List;

/**
 * @ProjectName : YoHuo001Java
 * @Author : 雷金泷
 * @Time : 2020/12/24 19:14
 * @Description : 文件描述
 */
public class MyCarAdapter extends BaseQuickAdapter<GoodsEntiy, BaseViewHolder> {
    public MyCarAdapter(int layoutResId, @Nullable List<GoodsEntiy> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsEntiy item) {
        helper.setChecked(R.id.item_car_cb,item.getSelect());
        Glide.with(mContext).load(item.getPicturl()).into((ImageView) helper.getView(R.id.item_car_iv));
        helper.setText(R.id.item_car_tv1,item.getTitle()+"");
        helper.setText(R.id.item_car_tv2,item.getPrice()+"");
        helper.setText(R.id.item_car_tv3,item.getSelect_num()+"");

        helper.addOnClickListener(R.id.item_car_cb)
                .addOnClickListener(R.id.item_car_bt1)
                .addOnClickListener(R.id.item_car_bt2);

    }
}
